package net.qiqbframework.modelling.command;

import net.qiqbframework.commandhandling.CommandMessage;

import net.qiqbframework.modelling.command.voucher.CommandLoadVoucher;
import net.qiqbframework.modelling.command.voucher.LoadVoucher;

import javax.annotation.Nonnull;
import java.util.Optional;

/**
 * 命令解析
 */
public interface CommandTargetResolver {

    /**
     * 解析命令中的加载凭证
     *
     * @param command
     * @return
     */
    LoadVoucher resolveLoadVoucher(@Nonnull CommandMessage<?> command);

    <C> Optional<CommandLoadVoucher<C>> resolveLoadVoucher1(@Nonnull CommandMessage<C> command);


}
